// 列表
<template>
    <div class="hello" style="background: red">
        <h1>子组件内容</h1>
        <p>{{msg}}</p>
        <p>{{msg2}}---{{parentval}}</p>
        <button @click="onBtn">子按钮</button>
    </div>
</template>
<script>
    export default {
        props:['parentval'], // 父向子传参
        //  数据
        data:function() {
            return {
                msg:'这里是子组件中的数据',
                msg2:'hello2',
            }
        },
        watch: {
        },
        methods: {
            onBtn:function(){
                console.log("子组件按钮----"+this.msg)
                this.$emit('child-tell-me-something',this.msg);
            }
        },
        mounted () {
        },
        beforeCreate(){
        },
    }
</script>
<style>

</style>

